
public class StringTest {
    public String name;
    public static void main(String[] args) {
        StringTest s = new StringTest();
        StringTest s1 = new StringTest();
        StringTest s2 = new StringTest();
        s.name = "yelong";
        s1.name = "yelong";
        s2.name = new String("yelong");
        System.out.println(s.name == s1.name);
        System.out.println(s.name == s2.name);
        String yf = "yelong" + "fengcongcong";
        String yfstr = "yelongfengcongcong";
        System.out.println(yf == yfstr);
        System.out.println(s1.name == s2.name.intern());
    }
}

 